home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc™ Source Code / Core / ODSessnB.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-28  |  23.9 KB  |  703 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ODSessnB.cpp
  3.  
  4.     Contains:    Base Session class implementation
  5.  
  6.     Owned by:    Nick Pilch
  7.  
  8.     Copyright:    © 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.         <19>     10/8/95    TJ        Fixes Recomended by Refball
  13.         <18>     9/27/95    TÇ        1287399 GM: Cyberdog needs chance to
  14.                                     cleanup before ODSession dies
  15.         <17>     8/26/95    TÇ        1274606 FB2: Patching Remarks
  16.         <16>     8/16/95    NP        1273600: FB: ShellSI is not ref-counted
  17.                                     correctly.
  18.         <15>      8/3/95    RR        #1257260: Collapse B classes. Remove
  19.                                     somInit methods. Don't call IsInitialized
  20.                                     or SubclassResponsibility
  21.         <14>     7/31/95    CG        #1270320: Delete _fInfo in somUnint.
  22.         <13>     5/26/95    DM        1251403: Multithreading naming support.
  23.         <12>     5/21/95    NP        1250142: AcquireShellSemtInterface should do
  24.                                     ref counting.
  25.         <11>     5/18/95    DM        #1250474: RemoveEntry(in ODType type)
  26.                                     inout->in
  27.         <10>     5/11/95    NP        1242421: Fix exception handling, 1248917:
  28.                                     Remove unused method.
  29.          <9>      1/9/95    NP        1196615: ODSession::Get/SetShellSemtIntf
  30.                                     changes.
  31.          <8>    11/15/94    NP        1200193-The Shell should instantiate its
  32.                                     Semantic Interface.
  33.          <7>     10/7/94    CC        1191489 - Moved UniqueUpdateID() to
  34.                                     ODSession.
  35.          <6>     8/22/94    TÇ        #1182448 System Process quits when no
  36.                                     OpenDoc documents are running
  37.          <5>     8/19/94    NP        1181622: Ownership fix.
  38.          <4>     8/17/94    jpa        Added tons of includes so somUninit will
  39.                                     delete the objects properly. [1181515]
  40.          <3>     8/13/94    NP        1180819-Added support for private
  41.                                     ScritingObject.
  42.          <2>     8/12/94    NP        1180762-added setters for getters. moved
  43.                                     stuff to non-B file. Removed
  44.                                     GetSemtInterface.
  45.          <1>     6/23/94    CG        first checked in
  46.         ------------------------------------------------------------
  47.          <3>      6/1/94    CG        Removed include for Binding.h
  48.          <2>     3/15/94    MB        Changes to support SCpp/ASLM builds,
  49.                                     #1150864.
  50.          <1>      2/3/94    CG        first checked in
  51.     
  52.     To Do:
  53.     In Progress:
  54.         - Not including SOM class headers so the 'delete' calls were
  55. not properly deleting the objects.
  56. */
  57.  
  58. #ifndef _PLFMDEF_
  59. #include "PlfmDef.h"
  60. #endif
  61.  
  62. #ifndef _ODUTILS_
  63. #include <ODUtils.h>
  64. #endif
  65.  
  66. #ifndef _DOCUTILS_
  67. #include <DocUtils.h>
  68. #endif
  69.  
  70. #ifndef _TOKNTABL_
  71. #include "ToknTabl.h"
  72. #endif
  73.  
  74. #ifndef SOM_ODSemanticInterface_xh
  75. #include "SemtIntB.xh"
  76. #endif
  77.  
  78. // We have to include the proper headers for the classes of all the
  79. // instance variables, so the proper destructors get called when they're deleted.
  80. #include <WinStat.xh>
  81. #include <Disptch.xh>
  82. #include <Arbitrat.xh>
  83. #include <Clipbd.xh>
  84. #include <DragDrp.xh>
  85. #include <LinkMgr.xh>
  86. #include <MssgIntf.xh>
  87. #include <NamRslvr.xh>
  88. #include <Translt.xh>
  89. #include <Undo.xh>
  90. #include "ToknTabl.h"
  91. #include <ODBindng.xh>
  92. #include <NmSpcMg.xh>
  93. #include <ODStor.xh>
  94. #include <Info.xh>
  95.  
  96. #define ODBaseSession_Class_Source
  97. #define VARIABLE_MACROS
  98. #include <ODSessnB.xih>
  99.  
  100. #pragma segment ODBaseSession
  101.  
  102. //==============================================================================
  103. // ODBaseSession
  104. //==============================================================================
  105.  
  106. //------------------------------------------------------------------------------
  107. // ODBaseSession: InitBaseSession
  108. //------------------------------------------------------------------------------
  109.  
  110. SOM_Scope void     SOMLINK ODBaseSessionInitBaseSession(ODBaseSession *somSelf, Environment *ev)
  111. {
  112.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  113.     ODBaseSessionMethodDebug("ODBaseSession","InitBaseSession");
  114.  
  115.     SOM_TRY
  116.     
  117.         /* Moved from somInit. SOM itself sets fields to zero
  118.         _fWindowState = kODNULL;
  119.         _fDispatcher = kODNULL;
  120.         _fArbitrator = kODNULL;
  121.         _fClipboard = kODNULL;
  122.         _fDragAndDrop = kODNULL;
  123.         _fLinkManager = kODNULL;
  124.         _fMessageInterface = kODNULL;
  125.         _fNameResolver = kODNULL;
  126.         _fTranslation = kODNULL;
  127.         _fUndo = kODNULL;
  128.         _fBinding = kODNULL;
  129.         _fNameSpaceManager = kODNULL;
  130.         _fStorage = kODNULL;
  131.         _fShellSemtInterface = kODNULL;
  132.         _fInfo = kODNULL;
  133.     
  134.         _fTokenTable = kODNULL;
  135.         _fScriptingObject = kODNULL;
  136.         */
  137.         somSelf->InitObject(ev);
  138.         
  139.     SOM_CATCH_ALL
  140.     SOM_ENDTRY
  141. }
  142. #if 0
  143. //------------------------------------------------------------------------------
  144. // ODBaseSession: Purge
  145. //------------------------------------------------------------------------------
  146.  
  147. SOM_Scope ODSize  SOMLINK ODBaseSessionPurge(ODBaseSession *somSelf, Environment *ev,
  148.         ODSize size)
  149. {
  150.     //ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  151.     ODBaseSessionMethodDebug("ODBaseSession","Purge");
  152.  
  153.     ODSize    retVal = 0; ODVolatile( retVal );
  154.  
  155.     SOM_TRY
  156.         retVal = ODBaseSession_parent_ODObject_Purge(somSelf, ev, size);
  157.     SOM_CATCH_ALL
  158.         WARN("Error %ld trying to purge in ODBaseSessionPurge",ErrorCode());
  159.         SetErrorCode(kODNoError);        // dh - Eat the exception; Purge should not 
  160.                                         // propagate it because clients function
  161.                                         // fine whether memory was purged or not.
  162.     SOM_ENDTRY
  163.     
  164.     return retVal;
  165. }
  166. #endif /* 0 */
  167. //------------------------------------------------------------------------------
  168. // ODBaseSession: somUninit
  169. //------------------------------------------------------------------------------
  170.  
  171. static void    DispatchExitEvent(Environment* ev, ODDispatcher* dispatcher)
  172. {
  173. // Copied from RealShell::FakePrintMenuEvent
  174.     ODEventData event;
  175.     event.message = 0L;
  176.     event.what = kODEvtExit;
  177.     // zero the rest of the fields
  178.     WASSERT( sizeof(Point) == sizeof(long) );
  179.     *(long*)&event.where = 0L;
  180.     event.when = 0L;
  181.     event.modifiers = 0;
  182.     dispatcher->Dispatch(ev, &event);
  183. }
  184.  
  185.  
  186. SOM_Scope void  SOMLINK ODBaseSessionsomUninit(ODBaseSession *somSelf)
  187. {
  188.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  189.     ODBaseSessionMethodDebug("ODBaseSession","somUninit");
  190.     Environment *ev = somGetGlobalEnvironment();
  191.     
  192.     TRY
  193.         DispatchExitEvent(ev, _fDispatcher);
  194.     //    close outstanding documents appropriately
  195.         ODDocument* document = kODNULL;
  196.         while ((document = ODGetFirstOpenDocument(ev, (ODSession*)somSelf)) != kODNULL)
  197.             ODCloseDocument(ev, (ODSession*)somSelf, document);
  198.     CATCH_ALL
  199.         WARN("Exit event or closing outstanding documents failed.");
  200.     ENDTRY
  201.  
  202.     ODDeleteObject(_fWindowState);
  203.     ODDeleteObject(_fDispatcher);
  204.     ODDeleteObject(_fArbitrator);
  205.     ODDeleteObject(_fClipboard);
  206.     ODDeleteObject(_fDragAndDrop);
  207.     ODDeleteObject(_fLinkManager);
  208.     ODDeleteObject(_fMessageInterface);
  209.     ODDeleteObject(_fNameResolver);
  210.     ODDeleteObject(_fTranslation);
  211.     ODDeleteObject(_fUndo);
  212.     ODDeleteObject(_fTokenTable);
  213.     ODDeleteObject(_fBinding);
  214.     ODDeleteObject(_fNameSpaceManager);
  215.     ODDeleteObject(_fStorage);
  216.     ODDeleteObject(_fInfo);
  217.     
  218.     ODSafeReleaseObject(_fShellSemtInterface); _fShellSemtInterface = kODNULL;
  219. }
  220.  
  221. //------------------------------------------------------------------------------
  222. // "Getters" / "Setters"
  223. //------------------------------------------------------------------------------
  224.  
  225. //------------------------------------------------------------------------------
  226. // ODBaseSession: GetWindowState
  227. //------------------------------------------------------------------------------
  228.  
  229. SOM_Scope ODWindowState*  SOMLINK ODBaseSessionGetWindowState(ODBaseSession *somSelf, Environment *ev)
  230. {
  231.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  232.     ODBaseSessionMethodDebug("ODBaseSession","GetWindowState");
  233.  
  234.     return _fWindowState;
  235. }
  236.  
  237. //------------------------------------------------------------------------------
  238. // ODBaseSession: SetWindowState
  239. //------------------------------------------------------------------------------
  240.  
  241. SOM_Scope void  SOMLINK ODBaseSessionSetWindowState(ODBaseSession *somSelf, Environment *ev,
  242.         ODWindowState* windowState)
  243. {
  244.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  245.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetWindowState");
  246.  
  247.     _fWindowState = windowState;
  248. }
  249.  
  250. //------------------------------------------------------------------------------
  251. // ODBaseSession: GetDispatcher
  252. //------------------------------------------------------------------------------
  253.  
  254. SOM_Scope ODDispatcher*  SOMLINK ODBaseSessionGetDispatcher(ODBaseSession *somSelf, Environment *ev)
  255. {
  256.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  257.     ODBaseSessionMethodDebug("ODBaseSession","GetDispatcher");
  258.  
  259.     return _fDispatcher;
  260. }
  261.  
  262. //------------------------------------------------------------------------------
  263. // ODBaseSession: SetDispatcher
  264. //------------------------------------------------------------------------------
  265.  
  266. SOM_Scope void  SOMLINK ODBaseSessionSetDispatcher(ODBaseSession *somSelf, Environment *ev,
  267.         ODDispatcher* dispatcher)
  268. {
  269.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  270.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetDispatcher");
  271.  
  272.     _fDispatcher = dispatcher;
  273. }
  274.  
  275. //------------------------------------------------------------------------------
  276. // ODBaseSession: GetArbitrator
  277. //------------------------------------------------------------------------------
  278.  
  279. SOM_Scope ODArbitrator*  SOMLINK ODBaseSessionGetArbitrator(ODBaseSession *somSelf, Environment *ev)
  280. {
  281.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  282.     ODBaseSessionMethodDebug("ODBaseSession","GetArbitrator");
  283.  
  284.     return _fArbitrator;
  285. }
  286.  
  287. //------------------------------------------------------------------------------
  288. // ODBaseSession: SetArbitrator
  289. //------------------------------------------------------------------------------
  290.  
  291. SOM_Scope void  SOMLINK ODBaseSessionSetArbitrator(ODBaseSession *somSelf, Environment *ev,
  292.         ODArbitrator* arbitrator)
  293. {
  294.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  295.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetArbitrator");
  296.  
  297.     _fArbitrator = arbitrator;
  298. }
  299.  
  300. //------------------------------------------------------------------------------
  301. // ODBaseSession: GetClipboard
  302. //------------------------------------------------------------------------------
  303.  
  304. SOM_Scope ODClipboard*  SOMLINK ODBaseSessionGetClipboard(ODBaseSession *somSelf, Environment *ev)
  305. {
  306.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  307.     ODBaseSessionMethodDebug("ODBaseSession","GetClipboard");
  308.  
  309.     return _fClipboard;
  310. }
  311.  
  312. //------------------------------------------------------------------------------
  313. // ODBaseSession: SetClipboard
  314. //------------------------------------------------------------------------------
  315.  
  316. SOM_Scope void  SOMLINK ODBaseSessionSetClipboard(ODBaseSession *somSelf, Environment *ev,
  317.         ODClipboard* clipboard)
  318. {
  319.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  320.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetClipboard");
  321.  
  322.     _fClipboard = clipboard;
  323. }
  324.  
  325. //------------------------------------------------------------------------------
  326. // ODBaseSession: GetDragAndDrop
  327. //------------------------------------------------------------------------------
  328.  
  329. SOM_Scope ODDragAndDrop*     SOMLINK ODBaseSessionGetDragAndDrop(ODBaseSession *somSelf, Environment *ev)
  330. {
  331.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  332.     ODBaseSessionMethodDebug("ODBaseSession","GetDragAndDrop");
  333.  
  334.     return _fDragAndDrop;
  335. }
  336.  
  337. //------------------------------------------------------------------------------
  338. // ODBaseSession: SetDragAndDrop
  339. //------------------------------------------------------------------------------
  340.  
  341. SOM_Scope void  SOMLINK ODBaseSessionSetDragAndDrop(ODBaseSession *somSelf, Environment *ev,
  342.         ODDragAndDrop* dragAndDrop)
  343. {
  344.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  345.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetDragAndDrop");
  346.  
  347.     _fDragAndDrop = dragAndDrop;
  348. }
  349.  
  350. //------------------------------------------------------------------------------
  351. // ODBaseSession: GetInfo
  352. //------------------------------------------------------------------------------
  353.  
  354. SOM_Scope ODInfo*     SOMLINK ODBaseSessionGetInfo(ODBaseSession *somSelf, Environment *ev)
  355. {
  356.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  357.     ODBaseSessionMethodDebug("ODBaseSession","GetInfo");
  358.  
  359.     return _fInfo;
  360. }
  361.  
  362. //------------------------------------------------------------------------------
  363. // ODBaseSession: SetInfo
  364. //------------------------------------------------------------------------------
  365.  
  366. SOM_Scope void     SOMLINK ODBaseSessionSetInfo(ODBaseSession *somSelf, Environment *ev, ODInfo* info)
  367. {
  368.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  369.     ODBaseSessionMethodDebug("ODBaseSession","SetInfo");
  370.  
  371.     _fInfo = info;
  372. }
  373.  
  374. //------------------------------------------------------------------------------
  375. // ODBaseSession: GetLinkManager
  376. //------------------------------------------------------------------------------
  377.  
  378. SOM_Scope ODLinkManager*     SOMLINK ODBaseSessionGetLinkManager(ODBaseSession *somSelf, Environment *ev)
  379. {
  380.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  381.     ODBaseSessionMethodDebug("ODBaseSession","GetLinkManager");
  382.  
  383.     return _fLinkManager;
  384. }
  385.  
  386. //------------------------------------------------------------------------------
  387. // ODBaseSession: SetLinkManager
  388. //------------------------------------------------------------------------------
  389.  
  390. SOM_Scope void  SOMLINK ODBaseSessionSetLinkManager(ODBaseSession *somSelf, Environment *ev,
  391.         ODLinkManager* linkManager)
  392. {
  393.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  394.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetLinkManager");
  395.  
  396.     _fLinkManager = linkManager;
  397. }
  398.  
  399. //------------------------------------------------------------------------------
  400. // ODBaseSession: GetMessageInterface
  401. //------------------------------------------------------------------------------
  402.  
  403. SOM_Scope ODMessageInterface*  SOMLINK ODBaseSessionGetMessageInterface(ODBaseSession *somSelf, Environment *ev)
  404. {
  405.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  406.     ODBaseSessionMethodDebug("ODBaseSession","GetMessageInterface");
  407.  
  408.     return _fMessageInterface;
  409. }
  410.  
  411. //------------------------------------------------------------------------------
  412. // ODBaseSession: SetMessageInterface
  413. //------------------------------------------------------------------------------
  414.  
  415. SOM_Scope void  SOMLINK ODBaseSessionSetMessageInterface(ODBaseSession *somSelf, Environment *ev,
  416.         ODMessageInterface* messageInterface)
  417. {
  418.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  419.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetMessageInterface");
  420.  
  421.     _fMessageInterface = messageInterface;
  422. }
  423.  
  424. //------------------------------------------------------------------------------
  425. // ODBaseSession: GetNameResolver
  426. //------------------------------------------------------------------------------
  427.  
  428. SOM_Scope ODNameResolver*  SOMLINK ODBaseSessionGetNameResolver(ODBaseSession *somSelf, Environment *ev)
  429. {
  430.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  431.     ODBaseSessionMethodDebug("ODBaseSession","GetNameResolver");
  432.  
  433.     return _fNameResolver;
  434. }
  435.  
  436. //------------------------------------------------------------------------------
  437. // ODBaseSession: SetNameResolver
  438. //------------------------------------------------------------------------------
  439.  
  440. SOM_Scope void  SOMLINK ODBaseSessionSetNameResolver(ODBaseSession *somSelf, Environment *ev,
  441.         ODNameResolver* nameResolver)
  442. {
  443.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  444.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetNameResolver");
  445.  
  446.     _fNameResolver = nameResolver;
  447. }
  448.  
  449. //------------------------------------------------------------------------------
  450. // ODBaseSession: GetTranslation
  451. //------------------------------------------------------------------------------
  452.  
  453. SOM_Scope ODTranslation*  SOMLINK ODBaseSessionGetTranslation(ODBaseSession *somSelf, Environment *ev)
  454. {
  455.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  456.     ODBaseSessionMethodDebug("ODBaseSession","GetTranslation");
  457.  
  458.     return _fTranslation;
  459. }
  460.  
  461. //------------------------------------------------------------------------------
  462. // ODBaseSession: SetTranslation
  463. //------------------------------------------------------------------------------
  464.  
  465. SOM_Scope void  SOMLINK ODBaseSessionSetTranslation(ODBaseSession *somSelf, Environment *ev,
  466.         ODTranslation* translation)
  467. {
  468.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  469.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetTranslation");
  470.  
  471.     _fTranslation = translation;
  472. }
  473.  
  474. //------------------------------------------------------------------------------
  475. // ODBaseSession: GetUndo
  476. //------------------------------------------------------------------------------
  477.  
  478. SOM_Scope ODUndo*  SOMLINK ODBaseSessionGetUndo(ODBaseSession *somSelf, Environment *ev)
  479. {
  480.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  481.     ODBaseSessionMethodDebug("ODBaseSession","GetUndo");
  482.  
  483.     return _fUndo;
  484. }
  485.  
  486. //------------------------------------------------------------------------------
  487. // ODBaseSession: SetUndo
  488. //------------------------------------------------------------------------------
  489.  
  490. SOM_Scope void  SOMLINK ODBaseSessionSetUndo(ODBaseSession *somSelf, Environment *ev,
  491.         ODUndo* undo)
  492. {
  493.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  494.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetUndo");
  495.  
  496.     _fUndo = undo;
  497. }
  498.  
  499. //------------------------------------------------------------------------------
  500. // ODBaseSession: GetStorageSystem
  501. //------------------------------------------------------------------------------
  502.  
  503. SOM_Scope ODStorageSystem*  SOMLINK ODBaseSessionGetStorageSystem(ODBaseSession *somSelf, Environment *ev)
  504. {
  505.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  506.     ODBaseSessionMethodDebug("ODBaseSession","GetStorageSystem");
  507.  
  508.     return _fStorage;
  509. }
  510.  
  511. //------------------------------------------------------------------------------
  512. // ODBaseSession: SetStorageSystem
  513. //------------------------------------------------------------------------------
  514.  
  515. SOM_Scope void  SOMLINK ODBaseSessionSetStorageSystem(ODBaseSession *somSelf, Environment *ev,
  516.         ODStorageSystem* storageSystem)
  517. {
  518.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  519.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetStorageSystem");
  520.  
  521.     _fStorage = storageSystem;
  522. }
  523.  
  524. //------------------------------------------------------------------------------
  525. // ODBaseSession: GetNameSpaceManager
  526. //------------------------------------------------------------------------------
  527.  
  528. SOM_Scope ODNameSpaceManager*  SOMLINK ODBaseSessionGetNameSpaceManager(ODBaseSession *somSelf, Environment *ev)
  529. {
  530.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  531.     ODBaseSessionMethodDebug("ODBaseSession","GetNameSpaceManager");
  532.  
  533.     return _fNameSpaceManager;
  534. }
  535.  
  536. //------------------------------------------------------------------------------
  537. // ODBaseSession: SetNameSpaceManager
  538. //------------------------------------------------------------------------------
  539.  
  540. SOM_Scope void  SOMLINK ODBaseSessionSetNameSpaceManager(ODBaseSession *somSelf, Environment *ev,
  541.         ODNameSpaceManager* nameSpaceManager)
  542. {
  543.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  544.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetNameSpaceManager");
  545.  
  546.     _fNameSpaceManager = nameSpaceManager;
  547. }
  548.  
  549. //------------------------------------------------------------------------------
  550. // ODBaseSession: GetBinding
  551. //------------------------------------------------------------------------------
  552.  
  553. SOM_Scope ODBinding*  SOMLINK ODBaseSessionGetBinding(ODBaseSession *somSelf, Environment *ev)
  554. {
  555.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  556.     ODBaseSessionMethodDebug("ODBaseSession","GetBinding");
  557.  
  558.     return _fBinding;
  559. }
  560.  
  561. //------------------------------------------------------------------------------
  562. // ODBaseSession: SetBinding
  563. //------------------------------------------------------------------------------
  564.  
  565. SOM_Scope void  SOMLINK ODBaseSessionSetBinding(ODBaseSession *somSelf, Environment *ev,
  566.         ODBinding* binding)
  567. {
  568.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  569.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetBinding");
  570.  
  571.     _fBinding = binding;
  572. }
  573.  
  574. //------------------------------------------------------------------------------
  575. // ODBaseSession: AcquireShellSemtInterface
  576. //------------------------------------------------------------------------------
  577.  
  578. SOM_Scope ODSemanticInterface*  SOMLINK ODBaseSessionAcquireShellSemtInterface(ODBaseSession *somSelf, Environment *ev)
  579. {
  580.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  581.     ODBaseSessionMethodDebug("ODBaseSession","AcquireShellSemtInterface");
  582.  
  583.     if (_fShellSemtInterface)
  584.         _fShellSemtInterface->Acquire(ev);
  585.     return _fShellSemtInterface;
  586. }
  587.  
  588. //------------------------------------------------------------------------------
  589. // ODBaseSession: SetShellSemtInterface
  590. //------------------------------------------------------------------------------
  591.  
  592. SOM_Scope void  SOMLINK ODBaseSessionSetShellSemtInterface(ODBaseSession *somSelf, Environment *ev,
  593.         ODSemanticInterface* shellSemanticInterface)
  594. {
  595.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  596.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetShellSemtInterface");
  597.  
  598.     SOM_TRY
  599.         ODReleaseObject(ev, _fShellSemtInterface);
  600.         if (shellSemanticInterface)
  601.             shellSemanticInterface->Acquire(ev);
  602.         _fShellSemtInterface = shellSemanticInterface;
  603.     SOM_CATCH_ALL
  604.     SOM_ENDTRY
  605. }
  606.  
  607. //------------------------------------------------------------------------------
  608. // ODBaseSession: Tokenize
  609. //------------------------------------------------------------------------------
  610.  
  611. SOM_Scope ODTypeToken  SOMLINK ODBaseSessionTokenize(ODBaseSession *somSelf, Environment *ev,
  612.         ODType type)
  613. {
  614.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  615.     ODBaseSessionMethodDebug("ODBaseSession","Tokenize");
  616.  
  617.     ODTypeToken    retVal = kODNullTypeToken;
  618.  
  619.     SOM_TRY
  620.         retVal = _fTokenTable->Tokenize(type);
  621.     SOM_CATCH_ALL
  622.     SOM_ENDTRY
  623.     
  624.     return retVal;
  625. }
  626.  
  627. //------------------------------------------------------------------------------
  628. // ODBaseSession: RemoveEntry
  629. //------------------------------------------------------------------------------
  630.  
  631. SOM_Scope void  SOMLINK ODBaseSessionRemoveEntry(ODBaseSession *somSelf, Environment *ev,
  632.         ODType type)
  633. {
  634.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  635.     ODBaseSessionMethodDebug("ODBaseSession","RemoveEntry");
  636.  
  637.     SOM_TRY
  638.         _fTokenTable->RemoveEntry(type);
  639.     SOM_CATCH_ALL
  640.     SOM_ENDTRY
  641. }
  642.  
  643. //------------------------------------------------------------------------------
  644. // ODBaseSession: GetType
  645. //------------------------------------------------------------------------------
  646.  
  647. SOM_Scope ODBoolean  SOMLINK ODBaseSessionGetType(ODBaseSession *somSelf, Environment *ev,
  648.         ODTypeToken token, ODType* type)
  649. {
  650.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  651.     ODBaseSessionMethodDebug("ODBaseSession","GetType");
  652.  
  653.     ODBoolean    retVal = kODFalse;
  654.  
  655.     SOM_TRY
  656.         retVal = _fTokenTable->GetType(token, type);
  657.     SOM_CATCH_ALL
  658.     SOM_ENDTRY
  659.     
  660.     return retVal;
  661. }
  662.  
  663. //------------------------------------------------------------------------------
  664. // ODBaseSession: GetTokenTable
  665. //------------------------------------------------------------------------------
  666.  
  667. SOM_Scope TokenTable*  SOMLINK ODBaseSessionGetTokenTable(ODBaseSession *somSelf, Environment *ev)
  668. {
  669.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  670.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionGetTokenTable");
  671.  
  672.     return _fTokenTable;
  673. }
  674.  
  675. //------------------------------------------------------------------------------
  676. // ODBaseSession: SetTokenTable
  677. //------------------------------------------------------------------------------
  678.  
  679. SOM_Scope void  SOMLINK ODBaseSessionSetTokenTable(ODBaseSession *somSelf, Environment *ev,
  680.         TokenTable* table)
  681. {
  682.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  683.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetTokenTable");
  684.  
  685.     _fTokenTable = table;
  686. }
  687. #if 0
  688. //------------------------------------------------------------------------------
  689. // ODBaseSession: GetScriptingbject
  690. //------------------------------------------------------------------------------
  691.  
  692. SOM_Scope ScriptingObject*  SOMLINK ODBaseSessionGetScriptingObject(ODBaseSession *somSelf, Environment *ev)
  693. {
  694.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  695.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionGetScriptingObject");
  696.  
  697. //    if (!_fScriptingObject)
  698. //        _fScriptingObject = new ScriptingObject;
  699. //    return _fScriptingObject;
  700.     return 0;
  701. }
  702. #endif /* 0 */
  703.